/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright @ Huawei Technologies Co., Ltd. 2024-2024. ALL rights reversed.
 */
#ifndef _LINUX_SYSMONITOR_FD_H
#define _LINUX_SYSMONITOR_FD_H

#include <linux/kernel.h>
#include <linux/proc_fs.h>
#include <linux/sched.h>
#include <linux/notifier.h>
#include <linux/seq_file.h>

struct fdstat {
	pid_t pid;
	unsigned int total_fd_num;
	char comm[TASK_COMM_LEN];
};

int register_fdstat_notifier(struct notifier_block *nb);
int unregister_fdstat_notifier(struct notifier_block *nb);
void fdthreshold_call_chain(unsigned int fd, unsigned int end);
void files_num_check(long nr_files, unsigned long max_files);
#endif /* _LINUX_SYSMONITOR_FD_H */
